<?php

/**
 * This is the model class for table "sekolahmuridgurusdswasta".
 *
 * The followings are the available columns in table 'sekolahmuridgurusdswasta':
 * @property integer $smgsds_id
 * @property integer $smgsds_kec
 * @property integer $smgsds_jmlsekolah
 * @property integer $smgsds_jmlmurid
 * @property integer $smgsds_jmlguru
 * @property integer $smgsds_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $smgsdsKec
 */
class Sekolahmuridgurusdswasta extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Sekolahmuridgurusdswasta the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sekolahmuridgurusdswasta';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('smgsds_kec, smgsds_jmlsekolah, smgsds_jmlmurid, smgsds_jmlguru, smgsds_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('smgsds_id, smgsds_kec, smgsds_jmlsekolah, smgsds_jmlmurid, smgsds_jmlguru, smgsds_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'smgsdsKec' => array(self::BELONGS_TO, 'Kecamatan', 'smgsds_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'smgsds_id' => 'Smgsds',
			'smgsds_kec' => 'Smgsds Kec',
			'smgsds_jmlsekolah' => 'Smgsds Jmlsekolah',
			'smgsds_jmlmurid' => 'Smgsds Jmlmurid',
			'smgsds_jmlguru' => 'Smgsds Jmlguru',
			'smgsds_tahun' => 'Smgsds Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('smgsds_id',$this->smgsds_id);
		$criteria->compare('smgsds_kec',$this->smgsds_kec);
		$criteria->compare('smgsds_jmlsekolah',$this->smgsds_jmlsekolah);
		$criteria->compare('smgsds_jmlmurid',$this->smgsds_jmlmurid);
		$criteria->compare('smgsds_jmlguru',$this->smgsds_jmlguru);
		$criteria->compare('smgsds_tahun',$this->smgsds_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}